//
// Created by Administrator on 2022/11/2.
//

#include <iostream>
#include "arrUtil.h"

using namespace std;

void insert(int a[], int l)
{
    for(int i = 0; i<l-1;i++)
    {
        int cur = a[i+1];
        int j = i;
        while(j>=0 and a[j]>cur)
        {
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=cur;
//        printf("i=%d, cur=%d,",i,cur);
//        printArr(a,l);
    }
}

int main()
{
//    int arr[] = {9,8,7,5,6,4,3,2,1,0};
    int len = 10;
    int arr[len];
    randomArr(arr,len);
    insert(arr,len);
    printf("%d\n",checkSort(arr,len));
    printArr(arr,len);
    return 0;
}

